package com.eies.business.applicate.indexsearch;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.eies.common.ConfigUtil;

public class NFDFlightDataTaskListener implements ServletContextListener {

	public void contextInitialized(ServletContextEvent event) {

		Properties prop = new Properties();
		InputStream in = this.getClass().getResourceAsStream(
				"indextable.properties");

		try {
			prop.load(in);
			if (prop.getProperty("indexRootDir") != null) {
				ConfigUtil.indexRootDirs = prop.getProperty("indexRootDirs");
			}
			if (prop.getProperty("tableNames") != null) {
				ConfigUtil.tableNames = prop.getProperty("tableNames");
			}
			if (prop.getProperty("hourOfDay") != null) {
				ConfigUtil.hourOfDay = prop.getProperty("hourOfDay");
			}
		} catch (IOException e) {
			e.printStackTrace();
		}

		new TimerManager();

	}

	public void contextDestroyed(ServletContextEvent event) {

	}

}
